package com.fancy.learncenter.adapter;

import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.widget.TextView;

import com.facebook.drawee.view.SimpleDraweeView;
import com.fancy.learncenter.activity.InviteDetailActivity;
import com.fancy.learncenter.activity.PersonResumeActivity;
import com.fancy.learncenter.activity.TrainApplyDetailActivity;
import com.fancy.learncenter.adapter.base.CommonRecycleViewAdapter;
import com.fancy.learncenter.adapter.base.CustomViewHold;
import com.fancy.learncenter.bean.ReciveResumeDataBean;
import com.superservice.lya.R;

import java.util.ArrayList;

/**
 * Created by hyy on 2018/2/24.
 * Explain activity as
 */

public class ShouDaoAdapter extends CommonRecycleViewAdapter<ReciveResumeDataBean> {
    public ShouDaoAdapter(Context mContext, ArrayList<ReciveResumeDataBean> itemDatas) {
        super(mContext, R.layout.fragment_shoudao_item, itemDatas);
    }

    @Override
    public void bindView(CustomViewHold customViewHold, final ReciveResumeDataBean item, int position) {

        SimpleDraweeView iamge_user = customViewHold.getView(R.id.iamge_user);
        iamge_user.setImageURI(item.getUser().getImgsrc());

        TextView name = customViewHold.getView(R.id.name);
        name.setText(item.getResume().getReal_name());

        TextView age = customViewHold.getView(R.id.age);
        age.setText(item.getResume().getAge());

        TextView time = customViewHold.getView(R.id.time);
        time.setText(item.getAdd_time());

        TextView work = customViewHold.getView(R.id.work);
        work.setText(item.getResume().getPosition());

        TextView phone = customViewHold.getView(R.id.phone);
        phone.setText(item.getResume().getMobile());

        TextView dec = customViewHold.getView(R.id.dec);
        dec.setText(item.getResume().getEducation() + "   " + item.getResume().getWork_year());

        customViewHold.getRoorView().setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(mContext, PersonResumeActivity.class);
                intent.putExtra("userId", item.getUser().getId());
                intent.putExtra("userImg", item.getUser().getImgsrc());
                mContext.startActivity(intent);
            }
        });
    }
}
